<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>

<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.8.3.js"></script>
<script type="text/javascript">

	$(
		function(){
			//定义后台url
			var url = "/day03/checkName";
			$("input:first").blur(
					function(){
						//获取输入框内容
						var uname = $(this).val();
						//发送get请求
						$.get(
								url,{"uname":uname},
								//data:就是一个json对象
								function(data){
									//data:是服务器响应的json数据
									$("#msg").html(data.msg);
								},
								"json"
								);
						}
					);
		}		
	);
</script>
</head>
<body>
<h2>注册页面</h2>
<form action="${pageContext.request.contextPath}/regist" method="post">
<input type="text"/>用户名<span id="msg"></span>
<input type="text"/>密码
<input type="submit" value="提交"/>
</form>

</body>
</html>